import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { GgVO, GgForm, GgQuery } from '@/api/business/gg/types';

/**
 * 查询CRUD地理位置列表
 * @param query
 * @returns {*}
 */

export const listGg = (query?: GgQuery): AxiosPromise<GgVO[]> => {
  return request({
    url: '/business/gg/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询CRUD地理位置详细
 * @param id
 */
export const getGg = (id: string | number): AxiosPromise<GgVO> => {
  return request({
    url: '/business/gg/' + id,
    method: 'get'
  });
};

/**
 * 新增CRUD地理位置
 * @param data
 */
export const addGg = (data: GgForm) => {
  return request({
    url: '/business/gg',
    method: 'post',
    data: data
  });
};

/**
 * 修改CRUD地理位置
 * @param data
 */
export const updateGg = (data: GgForm) => {
  return request({
    url: '/business/gg',
    method: 'put',
    data: data
  });
};

/**
 * 删除CRUD地理位置
 * @param id
 */
export const delGg = (id: string | number | Array<string | number>) => {
  return request({
    url: '/business/gg/' + id,
    method: 'delete'
  });
};
